Skip to content

Move email related tasks in the same queue #6553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

akatsoulas
Copy link
Collaborator

No description provided.

@akatsoulas akatsoulas requested review from Copilot and escattone March 11, 2025 10:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR moves email-related tasks to the same "email" queue to consolidate processing and simplify configuration.

  • Extended task_routes in the Celery configuration to include multiple email tasks.
  • Added routes for tasks from various modules to be processed in the "email" queue.

Reviewed Changes

File Description
kitsune/celery.py Updated task_routes to include additional email processing tasks.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@akatsoulas
Copy link
Collaborator Author

This PR moves all the email related tasks to the same pod. Currently we have the following processing order:

  • Emails are prepared in the email related tasks that run in multiple pods in the default queue
  • The email tasks from the default queue trigger the send_messages multiple times (one from each task in each pod)
  • Each worker in the pod that processes the email queue can run one of the send_messages
  • This introduces a cross-queue task generation which also increases the load
  • There's a potential for multiple emails because of tasks firing in quick succession and there's the potential for a task to run before the other has updated the database.

Even in the scenario that file locking and database updates happen in the right order and there are no issues, this PR will reduce the unnecessary load in the default queue

@escattone escattone merged commit 386e8b6 into mozilla:main Mar 11, 2025
2 checks passed
@akatsoulas akatsoulas deleted the duplicate-emails branch March 11, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants